﻿using Microsoft.AspNetCore.Mvc;
using MVC_System.DTO.BOM;
using MVC_System.DTO.RawMaterial;
using WMS_MAV;

namespace MVC_System.Controllers
{
    public class BOMController : Controller
    {
        private readonly IConfiguration _configuration;
        public BOMController(IConfiguration configuration)
        {
            _configuration = configuration;
        }
        public IActionResult BOMShow()
        {
            return View();
        }
        public IActionResult BOMAdd()
        {
            return View();
        }
        public async Task<ActionResult> BOMShows(BOMShowDTO dto)
        {
            HttpClientWrapper client = new HttpClientWrapper(dto.Token);
            string url = _configuration["Url"] + "RawApi/api/BOMs/BOMShow?PageIndex=" + dto.pageIndex + "&PageSize=" + dto.pageSize + "&BomNumbering=" + dto.bomNumbering + "&FinishedNumbering=" + dto.finishedNumbering;
            var respomse = await client.GetAsync(url);
            return Json(respomse);
        }
    }
}
